Skip to content

Conversation

@usrflo
Copy link
Contributor

@usrflo usrflo commented Oct 3, 2025

Without the definition of an ata_errors warning level the smart output of ATA Error Count: 0 ends up in ata_errors is non-zero (0)[/dev/sda] in the output.
So the zero case needs to be excluded explicitly checking ATA error counts.

@Napsty
Copy link
Owner

Napsty commented Oct 3, 2025

Thanks for the PR! Makes sense to me.
Can you just show the current behavior (execution and output of the plugin) in such a situation?

@usrflo
Copy link
Contributor Author

usrflo commented Oct 3, 2025

The output before excluding 0:

$ /usr/bin/sudo /usr/lib/nagios/plugins/check_smart.pl -g '/dev/sd[a-d]' -i 'ata' -w 'Reallocated_Sector_Ct=4,Runtime_Bad_Block=4,Uncorrectable_Error_Cnt=2,Reallocated_Event_Count=2' --skip-self-assessment
WARNING: [/dev/sda] - [/dev/sda] - ata_errors is non-zero (0)[/dev/sda] -  --- [/dev/sdc] - [/dev/sdc] - ata_errors is non-zero (0)[/dev/sdc] -  --- [/dev/sdd] - [/dev/sdd] - ata_errors is non-zero (0)[/dev/sdd] -  --- [/dev/sdb] - Device is clean

The output after excluding 0 via this patch:

$ /usr/bin/sudo /usr/lib/nagios/plugins/check_smart.pl -g '/dev/sd[a-d]' -i 'ata' -w 'Reallocated_Sector_Ct=4,Runtime_Bad_Block=4,Uncorrectable_Error_Cnt=2,Reallocated_Event_Count=2' --skip-self-assessment
OK: [/dev/sda] - Device is clean --- [/dev/sdb] - Device is clean --- [/dev/sdc] - Device is clean --- [/dev/sdd] - Device is clean|

@Napsty
Copy link
Owner

Napsty commented Oct 3, 2025

LGTM, thanks again!
Allow me some time for a version bump and new release.

@Napsty Napsty merged commit 27341d9 into Napsty:master Oct 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants